import configparser
import os

cur_path = os.path.dirname(os.path.realpath(__file__))
db_cfg_path = os.path.join(cur_path, "db.ini")

db_cfg = configparser.ConfigParser()
db_cfg.read(db_cfg_path)

host = db_cfg.get("ego_db", "host")
port = int(db_cfg.get("ego_db", "port"))
user = db_cfg.get("ego_db", "user")
password = db_cfg.get("ego_db", "password")
database = db_cfg.get("ego_db", "database")

if __name__ == '__main__':
    print(host, port, user, password, database)
    print(type(host), type(port), type(user), type(password), type(database))
